# Contributor: Milan P. Stanić <mps@arvanta.net>
# Maintainer: Milan P. Stanić <mps@arvanta.net>
pkgname=curlpp
pkgver=0.8.1
pkgrel=0
pkgdesc="C++ wrapper for libcURL"
url="http://curlpp.org"
arch="all"
license="MIT"
makedepends="cmake curl-dev"
options="!check" # no tests
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/jpbarrette/curlpp/archive/v$pkgver.tar.gz"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		$CMAKE_CROSSOPTS .
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="a46b47150c0f0f1f0056e08966ce2fefa5e86fc729406e0220fbcf400da5409f05c87b636b13da3c4d4460c1177aedb494b9569bbcd9012326d4d5f59376397e  curlpp-0.8.1.tar.gz"
